home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993 October: Windmill on DISC / ADC Developer CD (1993-10) (''Windmill On DISC'')_iso / Dev.CD Oct 93.iso / Utilities / Installer v3.4.3 / Examples - Installer 3.4 / Action Atom Samples / Simple Action Atom Sample / ActionAtomSample.r < prev    next >
Encoding:
Text File  |  1993-06-15  |  5.8 KB  |  184 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2.  *
  3.  *    Apple Macintosh Developer Technical Support
  4.  *
  5.  *  Installer 3.2 sample: Action Atoms
  6.  *
  7.  *    File:        ActionAtomSample.r -    Rez Source
  8.  *
  9.  *    by:         Jon Zap
  10.  *  updated for use with Installer 3.4 by: Rich Kubota 9/8/92
  11.  *            rrk - 5/19/93 Changed Target file spec typeCrMustMatch flag setting to
  12.  *                        typeCrNeedNotMatch and included comment that this will
  13.  *                        allow the replacement of the target file if for some reason
  14.  *                        the file or creator are different.
  15.  *                     Used InstallerCommon.r defines.
  16.  *            rrk - 9/8/92 changed inaa to reference format1 instead of format0.
  17.  *                    Added suspendBusyCursors flag to have arrow cursor displayed
  18.  *                    during the dialog.
  19.  *
  20.  *    Copyright © 1991 Apple Computer, Inc.
  21.  *    All rights reserved.
  22.  *
  23.  *------------------------------------------------------------------------------
  24.  *
  25.  * Install application "TheProgram" into the folder "Root":Installed Application.
  26.  * It demonstrates implementation of an action atom.
  27.  *----------------------------------------------------------------------------*/
  28. /*
  29.  
  30. You can build the script with the following lines:
  31.  
  32.         rez  -o "ActionAtomSample" -t 'bbkr' -c 'bbkr' "ActionAtomSample.r"
  33.         setfile -a i "ActionAtomSample"
  34.         scriptcheck -p "ActionAtomSample"
  35.  
  36. ------------------------------------------------------------------------------------------
  37. */
  38.  
  39. #include "Types.r"
  40. #include "InstallerTypes.r"
  41. #include "ActionAtomSelectors.h"
  42. #include "InstallerCommon.r"        /* list of macros to simplify list */
  43.  
  44. /* 'inaa' code resource definition */
  45. #define        aaCodeID                128
  46.  
  47. /* Definitions for the file spec atoms (specifications for source and destination files) */
  48. #define fsSourceProgram            2000
  49. #define fsTargetProgram            2001
  50.  
  51. /* This is the name of the source disk */
  52. #define ProgramDisk "Program Disk:"
  53.  
  54. /* where we want to install our file. */
  55. #define TargetPath    ":Installed Application:"
  56.  
  57. /* Definition for the package. */
  58. #define pkTheProgram            3000
  59.  
  60. /* Definition for the file atom */
  61. #define faProgram                4000
  62.  
  63. /* Definition for the package comment resource */
  64. #define cmtTheProgram            5000
  65.  
  66. /* Definitions for the action atom resources */
  67. #define aaAlertID                6000
  68.  
  69. /* May 19, 1993 is the current release date I put in 'icmt' rsrcs. ScriptCheck will convert */
  70. /* this value to a LongInt seconds value needed by the Installer. */
  71. #define currentReleaseDate        5191993    
  72. #define currentVersion            102     /* Version 1.0.2 goes in the 'icmt' rsrc */
  73.  
  74. #define iconTheProgram            5100
  75.  
  76. /************************** Easy Install Rule resources **********************************/
  77.  
  78. /***************************** Package Resources ************************************************/
  79. resource 'inpk' (pkTheProgram) {
  80.     format0 {
  81.         ShowsOnCustom,                 /* Package appears in the Custom Install display */
  82.         Removable,                    /* Package can be removed */
  83.         dontForceRestart,            /* no need to restart */
  84.         cmtTheProgram,                 /* package's 'icmt' resource id */
  85.         0,                            /* Package size (filled in by ScriptCheck) */
  86.         "TheProgram", {                /* package name for package that shows on custom */
  87.             'infa', faProgram;
  88.             'inaa', aaAlertID;
  89.         }
  90.     }
  91. };
  92.  
  93. /***************************** Comments ************************************************/
  94. resource 'icmt' (cmtTheProgram) {
  95.     currentReleaseDate,
  96.     currentVersion,
  97.     iconTheProgram,
  98.     "This package installs TeachText. "
  99. };
  100.  
  101. resource 'ICON' (iconTheProgram) {
  102.         $"0430 4000 0A50 A000 0B91 1002 0822 0803"
  103.         $"1224 0405 2028 0209 4010 0111 800C 00A1"
  104.         $"8003 FFC2 7E00 FF04 0100 7F04 0300 1E08"
  105.         $"04E0 000C 08E0 000A 10E0 0009 08C0 0006"
  106.         $"0487 FE04 0288 0104 0188 0084 0088 0044"
  107.         $"0088 0044 0088 00C4 0110 0188 0228 0310"
  108.         $"01C4 04E0 0002 0800 73BF FBEE 4CA2 8A2A"
  109.         $"40AA AAEA 52AA AA24 5EA2 8AEA 73BE FB8E",
  110. };
  111.  
  112.  
  113. /********************************************* File Specs ******************************************/
  114. /* Source File Specs */
  115. resource 'infs' (fsSourceProgram) {
  116.     'APPL',                                /* File Type */
  117.     'ttxt',                                /* Creator */
  118.     kScriptCheckSetsDate,                /* ScriptCheck fills in the creation date */
  119.     noSearchForFile,                    /* Do not search the source disk for the file */
  120.     TypeCrMustMatch,                    /* file type and creator on source disk must match */
  121.     ProgramDisk"TeachText"                /* Path to the file */
  122. };
  123.  
  124. /* Target File Specs */
  125. resource 'infs' (fsTargetProgram) {
  126.     'APPL',                                /* File Type */
  127.     'ttxt',                                /* Creator */
  128.     kNoDateStampCheck,                    /* creation date must be zero for target file spec */
  129.     noSearchForFile,                    /* Do not search the target disk for the file */
  130.     typeCrNeedNotMatch,                    /* file to be replaced even if F&C don't match  */
  131.     TargetPath"TeachText"                /* destination Path */
  132. };
  133.  
  134. /******************************************** File Atoms ************************************************/
  135. resource 'infa' (faProgram) {
  136.     format0 {
  137.         StdRemLeaveNewerCopy,            /* see InstallerCommon.r */
  138.         fsTargetProgram,                /* TARGET file spec for this file */
  139.         fsSourceProgram,                 /* SOURCE file spec for this file */
  140.         0,                                /* atom size (filled in by ScriptCheck) */
  141.         ""                                /* Atom Description (Installer will use file name) */
  142.     };
  143. };
  144.  
  145.  
  146. resource 'inaa'    (aaAlertID) {
  147.     format1 {
  148.         suspendBusyCursors,
  149.         actBefore,
  150.         dontActOnRemove,
  151.         actOnInstall,
  152.         'infn',
  153.         aaCodeID,
  154.         ShowAlertSelector,
  155.         "Display message to user."
  156.     }
  157. };
  158.  
  159. /* Note that since the action atom is listed as actBefore, the Installer will not call
  160.    it with a cleanUpCancel message.  For this to happen you need to implement and
  161.    Action atom with the actAfter flag set.
  162.  */
  163.  
  164. resource 'ALRT' (aaCodeID) {
  165.     {0, 0, 150, 360},
  166.         aaCodeID,
  167.     {
  168.         OK, visible, sound1,
  169.         OK, visible, sound1,
  170.         OK, visible, sound1,
  171.         OK, visible, sound1
  172.     }
  173. };
  174.  
  175. resource 'DITL' (aaCodeID) {
  176.     {
  177.         {122, 280, 142, 348}, Button { enabled, "OK" },
  178.         {8, 64, 96, 348}, StaticText { disabled, "This space available." }
  179.     }
  180. };
  181.  
  182. INCLUDE    "ActionAtomSample.rsrc" 'infn' (1001) AS 'infn' (aaCodeID, $$Attributes);
  183.  
  184.